package avortep.synchro;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DBMSSqlReader extends DBSqlReader {

	public DBMSSqlReader() {
		this.schemaName = "TABLE_SCHEMA";
		this.sqlGetTables = 
			"SELECT [TABLE_NAME], [TABLE_SCHEMA] FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'";
		this.sqlGetViews = 	
			"SELECT [TABLE_NAME], [TABLE_SCHEMA], [VIEW_DEFINITION] as [VIEW_SOURCE] FROM INFORMATION_SCHEMA.VIEWS";
		this.sqlGetColumns =
			"SELECT [COLUMN_NAME], [TABLE_NAME], [TABLE_SCHEMA], [DATA_TYPE] as [TYPE_NAME], [COLUMN_DEFAULT], [IS_NULLABLE]"
			+" FROM [pubs].[INFORMATION_SCHEMA].[COLUMNS] ORDER BY [COLUMN_NAME], [ORDINAL_POSITION]";

	}

	protected boolean getIsNullable(ResultSet data) throws SQLException {
		return (data.getString(isNullable).equals("YES"));
	}
	
	protected String getCheck(ResultSet data) throws SQLException {
		return null;		
	}	
}
